<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Task Tracker</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Le styles -->
<link href="<s:url value="/css/bootstrap.css" />" rel="stylesheet">
<link href="<s:url value="/css/bootstrap-responsive.css" />"
	rel="stylesheet">
<link
	href="<s:url value="/css/ui-lightness/jquery-ui-1.8.20.custom.css" />"
	rel="stylesheet">

<!-- Le scripts -->
<script src="<s:url value="/js/jquery-1.7.2.min.js" />"></script>
<script src="<s:url value="/js/bootstrap.js" />"></script>
<script type="text/javascript" src="<s:url value="/js//jquery.blockUI.js" />"></script>
<script src="<s:url value="/js/jquery.validate.js" />"></script>

<script type="text/javascript">


	$(function() {
	
	});

	$(document).ready(function() {
		$('#windowTitleDialog').bind('show');
	});

	function closeDialog() {
		$('#windowTitleDialog').modal('hide');
	};

	function loadNewUserForm() {

		$.post('./userperson/loadUserPersonForm.action',function(resultadoHTML) {
					$('#formAddUser').html(resultadoHTML);
				});
	};
</script>

</head>

<body>

	<div class="container">
	
		<div class="page-header">
	  		<h1>Task Tracker <small>Please log in to continue</small></h1>
		</div>
		
		<div class="span4 offset4">
			<form class="well" action="j_spring_security_check" method="POST">

				<label>Username</label> <input type="text" class="span3"
					name='j_username' placeholder="Type your user name"> <label>Password</label>
				<input type="password" class="span3" name='j_password'
					placeholder="Type your user name">
				<%if (request.getParameter("login_error") != null) {%>
					<span class="label label-important">Enter a valid username and password</span><br><br>
				<%}%>	
				<button type="submit" class="btn">Login</button>
				<a data-toggle="modal" href="#windowTitleDialog" class="btn"
					onclick="loadNewUserForm()">+New user</a>
			</form>
		</div>
		
		<div class="modal hide fade" id="windowTitleDialog">
			<div class="modal-header">
				<a href="#" class="close" data-dismiss="modal">&times;</a>
				<h3>Add a new user</h3>
			</div>
			<div class="modal-body" id="formAddUser">
				<img alt="loading" src="img/ajax-loader.gif">
			</div>
			<div class="modal-footer">
				<a href="#" class="btn" onclick="closeDialog ();">Go back</a>
			</div>
		</div>
		
		
		
	</div>
</body>
</html>